$(function(){
	rexiao();
});

var currentPage=1;
//热销
var ss=0;
var yy=1;
function  rexiao(){
	if(ss!=0 || currentPage==1){
    $.ajax({
			url: urlcore + "/api/shopInfo/getShopListByWeek?current="+currentPage,
			type: "get",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			success:function(data){
				ss=data.data.list.length;
				$.each(data.data.list,function(y,n){
	var dianpuxinxi=
	'<div class="jg_rexiao">'+
		'<dl class="clearfix">'+
			'<a href="6.0.0dianpu.html?id='+n.id+'">'+
				'<dt class="clearfix">'+
				'<span>'+yy+'</span>'+
					'<img onerror="errorImg(this)" src="'+n.storeImg+'" />'+
				'</dt>'+
				'<dd>'+
					'<h5 class="clearfix">'+n.storeName+'<div class="fr public_star">';
						if(n.creditLevel!='' && n.creditLevel!=0){
							if(n.creditLevel<=5){
                  	  for(var i=0;i<n.creditLevel;i++){
                       dianpuxinxi+='<img src="images/detail_bottom05.png"/>';
                        }
                  	  var sunq=5;
                  	  	  for(var s=0;s<sunq-n.creditLevel;s++){
                       dianpuxinxi+='<img src="images/xin2.png"/>';
                        }
                  }else if(n.creditLevel<=10){
                  	var credit=n.creditLevel-5;
                  	  for(var i=0;i<credit;i++){
                      dianpuxinxi+='<img src="images/zhuanshi.png"/>';
                  }
                  	  var sunq=5;
                  	 for(var i=0;i<sunq-credit;i++){
                    	dianpuxinxi+='<img src="images/zhuanshi2.png"/>';
                  }
                  
                  	  
                  }else if(n.creditLevel<=15){
                  	var credit=n.creditLevel-10;
                  	 for(var i=0;i<credit;i++){
                       dianpuxinxi+='<img src="images/guan.png"/>';
                  }
                  	 
                  	     var sunq=5;
                  	 for(var i=0;i<sunq-credit;i++){
                    	dianpuxinxi+='<img src="images/guan2.png"/>';
                  }
                  	 
                  }
						}
						/*	dianpuxinxi+='<span>'+n.creditLevel+'分</span>'+*/
						dianpuxinxi+='</div>'+
					'</h5>'+
					'<p>周销售指数'+n.saleNumWeek+'</p>'+
				'</dd>'+
			'</a>'+
		'</dl>'+
	'</div>';
	              $("#rexiaopaihang").append(dianpuxinxi);
	              	yy++;
				});
			},
			error:function() {
				/* Act on the event*/ 
				alert("error");
			}
		});
	}
	}
